package state;

/**
 * Remarks:
 * Class name :Join
 * Date :2023/2/14 17:09
 * Author:杨俊源
 */
public class Join implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("线程VIP来了 " + i);
        }
    }

    public static void main(String[] args) {
        Join join = new Join();
        Thread thread = new Thread(join);
        thread.start();

        for (int i = 0; i < 500; i++) {
            if (i == 200){
                try {
                    //插队操作
                    thread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("main " + i);
        }
    }
}
